﻿/*
 * Copyright (c) HiSilicon (Shanghai) Technologies Co., Ltd. 2020-2022. All rights reserved.
 * Description: Header file for frw_rom_cb.c.
 */

#ifndef FRW_ROM_CB_ROM_H
#define FRW_ROM_CB_ROM_H

/*****************************************************************************
  1 头文件包含
*****************************************************************************/
#include "oal_ext_if_rom.h"

#ifdef __cplusplus
#if __cplusplus
extern "C" {
#endif
#endif

/*****************************************************************************
 2 枚举定义
*****************************************************************************/
typedef enum {
    FRW_ROM_CB_START = 0,
    FRW_ROM_CB_IRQ_MAC_ISR = FRW_ROM_CB_START,     /* mac 中断处理钩子 */
    FRW_ROM_CB_IRQ_PHY_ISR,                        /* phy 中断处理钩子 */
    FRW_ROM_CB_SET_BANDWIDTH_MODE,                 /* 设置带宽配置 */
    FRW_ROM_CB_DUMP_TX_DSCR,                       /* 打印tx描述符 */
    FRW_ROM_CB_PKT_DBG,                            /* 报文转发诊断 */
    FRW_ROM_CB_RF_RES_FREE,                        /* hal_rf_res_free */
    FRW_ROM_CB_RF_TEMPERATURE_TRIG_CALI,           /* 温度触发校准 */
    FRW_ROM_CB_RF_SET_CHANNEL_INFO,                /* fe_hal_rf_set_channel_info */
    FRW_ROM_CB_RF_DEV_SET_OPS_EXT,                 /* fe_rf_dev_set_ops_ext */
    FRW_ROM_CB_RF_DEV_INIT,                        /* fe_rf_dev_init */
    FRW_ROM_CB_PSM_ABB_DISABLE,                    /* fe_rf_disable_abb */
    FRW_ROM_CB_FE_HAL_PROC_RF_WORK,                /* fe_hal_proc_rf_work */
    FRW_ROM_CB_FE_HAL_PROC_RF_SLEEP,               /* fe_hal_proc_rf_sleep */
    FRW_ROM_CB_FE_HAL_RF_OP_TX,                    /* fe_hal_rf_open_close_tx */
    FRW_ROM_CB_FE_HAL_RF_OP_PLL,                   /* fe_hal_rf_open_close_pll */
    FRW_ROM_CB_FE_HAL_RF_OP_LDO,                   /* fe_hal_rf_open_close_ldo */
    FRW_ROM_CB_RF_GET_CUS_CCA_ED,                  /* fe_rf_get_customized_cca_ed */
    FRW_ROM_CB_RF_SET_PHY_FILER,
    FRW_ROM_CB_HE_TRIG_UPDATE_CODE,
    FRW_ROM_CB_RF_SYNC_TPC_POW_RATE_TABLE,         /* fe_hal_sync_tpc_pow_rate_table */
    FRW_ROM_CB_RF_GET_TPC_POW_RATE_TABLE_TPC_CODE, /* fe_tpc_rate_pow_get_rate_tpc_code */
    FRW_ROM_CB_ONLINE_CALI_PROC_TX_SEND,           /* online_cali_proc_tx_send */
    FRW_ROM_CB_ONLINE_CALI_GET_PDET_VAL,           /* online_cali_get_pdet_val */
    FRW_ROM_CB_ONLINE_CALI_PROC_TX_COMPLETE,       /* online_cali_proc_tx_complete */
    FRW_ROM_CB_ONLINE_CALI_PROC_SET_CHANNEL,       /* online_cali_proc_set_channel */
    FRW_ROM_CB_RF_FSM_GET_STATE,                   /* fe_rf_fsm_get_state */
    FRW_ROM_CB_RF_DEV_ENABLE_TX,                   /* fe_rf_dev_enable_tx */
    FRW_ROM_CB_RF_DEV_SLEEP,                       /* fe_rf_dev_sleep */
    FRW_ROM_CB_RF_PROC_AWAKE,                      /* fe_rf_proc_rf_awake */
    FRW_ROM_CB_RF_ENABLE_TX,                       /* fe_rf_enable_rf_tx */
    FRW_ROM_CB_RF_PROC_SLEEP,                      /* fe_rf_proc_rf_sleep */
    FRW_ROM_CB_RF_DISABLE_TX,                      /* fe_rf_disable_rf_tx */
    FRW_ROM_CB_RF_SET_CHANNEL,                     /* fe_rf_set_rf_channel */

    FRW_ROM_CB_MAC_ERR_IRQ,                        /* hh503_irq_mac_err_cb */
    FRW_ROM_CB_MAC_TWT_REG_SET,                    /* hh503_vap_set_twt_cb */
    FRW_ROM_CB_RADAR_SENSOR_DET,
    FRW_ROM_CB_MAC_PM_VOTE_PLAT,
    FRW_ROM_CB_COEX_PROCESS_BLE_STATUS,            /* hal_btcoex_process_bt_status_cb */
    FRW_ROM_CB_COEX_PROCESS_MODE_SELECT,
    FRW_ROM_CB_COEX_PROCESS_PM,
    FRW_ROM_CB_COEX_CLOSE_RTS,
    FRW_ROM_CB_COEX_SYNC_RF_PHY,
    FRW_ROM_CB_COEX_PS_ON,
    FRW_ROM_CB_COEX_PS_OFF,
    FRW_ROM_CB_DISPATCH_TRIGGER_EVENT,

    /* 算法HOOK，START */
    FRW_ROM_CB_ALG_DBAC_UPDATE_DUAL_STA_POLICY,
    FRW_ROM_CB_ALG_DBAC_UPDATE_STA_GO_POLICY,
    FRW_ROM_CB_ALG_DBAC_START_WORK,
    FRW_ROM_CB_ALG_DBAC_STOP_WORK,
    FRW_ROM_CB_ALG_DBAC_SYNC_STA_AP_TBTT,
    FRW_ROM_CB_ALG_DBAC_NOT_READY,
    FRW_ROM_CB_ALG_DBAC_CHBA_ISR,
    FRW_ROM_CB_ALG_DBAC_CHBA_PARSE_TYPE,
    FRW_ROM_CB_ALG_DBAC_NOA_PARA_CHANGE,
    FRW_ROM_CB_ALG_DBAC_STA_NEED_PREEMPT_GC,
    FRW_ROM_CB_ALG_DBAC_FCS_CONFIG,
    FRW_ROM_CB_ALG_DBAC_PARSE_VAP,
    FRW_ROM_CB_ALG_DBAC_TX_PROCESS,
    FRW_ROM_CB_ALG_DBAC_RX_PROCESS,
    FRW_ROM_CB_ALG_DBAC_TBTT_ISR,
    FRW_ROM_CB_ALG_DBAC_NOA_ISR,
    FRW_ROM_CB_ALG_DBAC_TBTT_DELAY_ISR,
    FRW_ROM_CB_ALG_DBAC_SET_NOA,
    FRW_ROM_CB_ALG_DBAC_RESTART_DYNAMIC,
    FRW_ROM_CB_ALG_DBAC_RESUME_VAP,
    FRW_ROM_CB_ALG_DBAC_TIMER_ISR,
    FRW_ROM_CB_ALG_DBAC_CHBA_MODE,
    FRW_ROM_CB_ALG_DBAC_RESERVE_NETBUF,
    FRW_ROM_CB_ALG_DBAC_CHBA_BITMAP,

    FRW_ROM_CB_ALG_EDCA_INIT,
    FRW_ROM_CB_ALG_EDCA_EXIT,
    FRW_ROM_CB_ALG_EDCA_TX_COMPLETE_PROCESS,

    FRW_ROM_CB_ALG_TRAFFIC_CTL_INIT,
    FRW_ROM_CB_ALG_TRAFFIC_CTL_EXIT,
    FRW_ROM_CB_ALG_TRAFFIC_CTL_TX_CONFIG,
    FRW_ROM_CB_ALG_TRAFFIC_CTL_TIMER,
    FRW_ROM_CB_ALG_TRAFFIC_CTL_DOWNLINK,
    FRW_ROM_CB_ALG_TRAFFIC_CTL_FREE,
    FRW_ROM_CB_ALG_TRAFFIC_CTL_ALLOC,
    FRW_ROM_CB_ALG_TRAFFIC_CTL_ADD_USER,
    FRW_ROM_CB_ALG_TRAFFIC_CTL_DEL_USER,
    FRW_ROM_CB_ALG_TRAFFIC_CTL_TX_COMPLETE,
    FRW_ROM_CB_ALG_TRAFFIC_CTL_ADD_VAP,
    FRW_ROM_CB_ALG_TRAFFIC_CTL_DEL_VAP,
    FRW_ROM_CB_ALG_TRAFFIC_CTL_RX_THRES,
    FRW_ROM_CB_ALG_TRAFFIC_CTL_TX_FLOWCTL,

    FRW_ROM_CB_ALG_AR_START_VAP,
    FRW_ROM_CB_ALG_AR_DEL_VAP,
    FRW_ROM_CB_ALG_AR_INIT_USER,
    FRW_ROM_CB_ALG_AR_EXIT_USER,
    FRW_ROM_CB_ALG_AR_TX_PROCESS_SET_FIX_RATE,
    FRW_ROM_CB_ALG_AR_TX_PROCESS,
    FRW_ROM_CB_ALG_AR_RX_PROCESS,
    FRW_ROM_CB_ALG_AR_INTF_CHANGE_PROC,
    FRW_ROM_CB_ALG_AR_TX_COMP_ABNORMAL_PROCESS,
    FRW_ROM_CB_ALG_AR_TX_COMP_PROCESS,
    FRW_ROM_CB_ALG_AR_TX_COMP_UPDATE_PER,
    FRW_ROM_CB_ALG_AR_EVENT_TRIG_PROBE,
    FRW_ROM_CB_ALG_AR_PROBE_MCS_PREPARE,
    FRW_ROM_CB_ALG_AR_PROBE_INIT,
    FRW_ROM_CB_ALG_AR_PROBE_FINISH,
    FRW_ROM_CB_ALG_AR_PROBE_FINISH_UPDATE_INFO,
    FRW_ROM_CB_ALG_AR_PROBE_RESULT_UPDATE,
    FRW_ROM_CB_ALG_AR_PROBE_RESULT_ANALYSIS,
    FRW_ROM_CB_ALG_AR_CFG,

    FRW_ROM_CB_ALG_TPC_INIT_USER,
    FRW_ROM_CB_ALG_TPC_TX_PROCESS,
    FRW_ROM_CB_ALG_TPC_RX_PROCESS,
    FRW_ROM_CB_ALG_TPC_RX_MGMT_PROCESS,
    FRW_ROM_CB_ALG_TPC_UPDATE_POWER,
    FRW_ROM_CB_ALG_TPC_SET_TX_PARA,
    FRW_ROM_CB_ALG_TPC_SET_MODE,
    FRW_ROM_CB_ALG_TPC_TX_COMPLETE_PROCESS,
    FRW_ROM_CB_ALG_TPC_TX_QUERY,
    FRW_ROM_CB_ALG_TPC_USER_DISTANC_JUDGE,
    FRW_ROM_CB_ALG_TPC_DISTANCE_CHANGED,

    FRW_ROM_CB_ALG_TXBF_INIT,

    FRW_ROM_CB_ALG_INTERNAL_HOOK_INIT,
    FRW_ROM_CB_ALG_INTERNAL_HOOK_EXIT,
    FRW_ROM_CB_ALG_DMAC_CONFIG_PARAM,

    FRW_ROM_CB_ALG_COMMON_INIT,
    FRW_ROM_CB_ALG_COMMON_INIT_USER,
    FRW_ROM_CB_ALG_COMMON_EXIT,
    FRW_ROM_CB_ALG_COMMON_EXIT_USER,
    FRW_ROM_CB_ALG_COMMON_TX_COMPLETE,

    FRW_ROM_CB_ALG_INTF_DEV_INIT,
    FRW_ROM_CB_ALG_INTF_TX_COMPLETE_PROCESS,

    FRW_ROM_CB_ALG_AGGR_INIT,
    FRW_ROM_CB_ALG_AGGR_EXIT,
    FRW_ROM_CB_ALG_AGGR_INIT_USER,
    FRW_ROM_CB_ALG_AGGR_NORMAL_PROC,
    FRW_ROM_CB_ALG_AGGR_TX_COMP,
    FRW_ROM_CB_ALG_AGGR_SET_SCH_AGGR,
    FRW_ROM_CB_ALG_AGGR_BRATE_UPDATE,
    FRW_ROM_CB_ALG_AGGR_TX_PAYLOAD_LEN_CHK,
    FRW_ROM_CB_ALG_AGGR_ADJINTF_NOTIFY,
    FRW_ROM_CB_ALG_AGGR_SET_CFG,
    FRW_ROM_CB_ALG_AGGR_TX_PROBE_PROC,
    FRW_ROM_CB_ALG_AGGR_CHK_PROBE_DOWN,
    FRW_ROM_CB_ALG_AGGR_PROBE_UP_BYTES,
    FRW_ROM_CB_ALG_AGGR_PROBE_UP_UPDATE,
    FRW_ROM_CB_ALG_AGGR_PROBE_UP_PROC,
    FRW_ROM_CB_ALG_AGGR_PROBE_DOWN_UPDATE,
    FRW_ROM_CB_ALG_AGGR_PROBE_DOWN_PROC,
    FRW_ROM_CB_ALG_AGGR_PROBE_SENT,

    FRW_ROM_CB_ALG_RTS_DEV_INIT,
    FRW_ROM_CB_ALG_RTS_TX_PROCESS,
    FRW_ROM_CB_ALG_RTS_TX_COMP_PROCESS,
    FRW_ROM_CB_ALG_RTS_RATE_TX_PARAM,
    FRW_ROM_CB_ALG_RTS_TX_PAYLOAD_LEN_NOTIFY,

    FRW_ROM_CB_ALG_MEM_ALLOC,

    FRW_ROM_CB_ALG_TX_TB_INIT,
    FRW_ROM_CB_ALG_TX_TB_COMPUTE_AGGR_NUMS,
    FRW_ROM_CB_ALG_TX_TB_UL_OFDMA,

    FRW_ROM_CB_DMAC_ALG_TX_COMP,
    FRW_ROM_CB_DMAC_ALG_RX,
    FRW_ROM_CB_DMAC_ALG_TX,
    /* 算法HOOK，END */

#ifdef _PRE_WLAN_FEATURE_CHBA
    FRW_ROM_CB_CHBA_RCV_H2D_MSG,
    FRW_ROM_CB_CHBA_SEND_D2H_MSG,
    FRW_ROM_CB_CHBA_TWT_START,
    FRW_ROM_CB_CHBA_TWT_END,
#endif

    FRW_ROM_CB_SDP_FIND_UP_VAP,
    FRW_ROM_CB_SDP_PEROID_TIMER,
    FRW_ROM_CB_SDP_WAKE_TIMER,
    FRW_ROM_CB_SDP_DW_TIMER,
    FRW_ROM_CB_SDP_PROC_WAKEUP_TIMER,
    FRW_ROM_CB_SDP_RX_FRAME,
    FRW_ROM_CB_SDP_PRIVATE_FRAME,
    FRW_ROM_CB_SDP_ACTION_FRAME,
    FRW_ROM_CB_SDP_SWITCH_OFF,

    FRW_ROM_CB_SET_PRIMARY_CHANNEL,
    FRW_ROM_CB_SET_CHANNEL_FREQ,

    FRW_ROM_CB_PSD_DET,

#ifdef _PRE_WLAN_LATENCY_STAT
    FRM_ROM_CB_LATENCY_RX_ENTRY,
#endif

    FRW_ROM_CB_P2P_NOA_ADSENT_END,
    FRW_ROM_CB_P2P_NOA_ADSENT_START,
    FRW_ROM_CB_P2P_SET_NOA,
    FRW_ROM_CB_P2P_SET_NOA_INFO,
    FRW_ROM_CB_P2P_SET_NOA_PARAM,
    FRW_ROM_CB_P2P_CT_WINDOW_END,
    FRW_ROM_CB_P2P_HANDLE,
    FRW_ROM_CB_P2P_DMAC_NOA_ADSENT_START,
    FRW_ROM_CB_P2P_DMAC_NOA_ADSENT_END,

#ifdef _PRE_WLAN_FEATURE_CSI
    FRW_ROM_CB_IRQ_CSI_RX_COMPLETE_ISR,
    FRW_ROM_CB_DMAC_HAL_CSI_SYNC_CFG,
    FRW_ROM_CB_CSI_KEEP_MAC_PA_OPEN,
#endif

    FRW_ROM_CB_MEM_EXIT,
    FRW_ROM_CB_MEM_RSV,
    FRW_ROM_CB_MEM_RESTORE,

    FRW_ROM_CB_DMAC_PSM_STATE_TRANS,
    FRW_ROM_CB_DMAC_PSM_DOZE_EVENT,
    FRW_ROM_CB_DMAC_PSM_AWAKE_EVENT,
    FRW_ROM_CB_DMAC_TWT_TEARDOWN,
    FRW_ROM_CB_DMAC_PSM_ALARM,
    FRW_ROM_CB_DMAC_PSM_PARAM_ININT,
    FRW_ROM_CB_DMAC_PSM_UPDATE_DTIM,
    FRW_ROM_CB_DMAC_PSM_UPDATE_KEEPALIVE,
    FRW_ROM_CB_DMAC_PSM_PM_ON,
    FRW_ROM_CB_DMAC_PSM_TX_COMPLETE,
    FRW_ROM_CB_DMAC_PSM_MGMT_RETRY,
    FRW_ROM_CB_DMAC_PSM_AP_PROCESS_DATA,
    FRW_ROM_CB_DMAC_PSM_AP_PROCESS_PSPOLL,
    FRW_ROM_CB_DMAC_PSM_AP_PROCESS_AWAKE,
    FRW_ROM_CB_DMAC_PSM_AP_PROCESS_DOZE,
    FRW_ROM_CB_DMAC_PSM_BACK_NORMAL,
    FRW_ROM_CB_DMAC_PSM_DSCR_ENQUEUE,
    FRW_ROM_CB_DMAC_PSM_MPDU_DEQUEUE,
#ifdef _PRE_WLAN_FEATURE_POWERSAVE
    FRW_ROM_CB_DMAC_STA_PM_WAKEUP_HOST,
#endif

    FRW_ROM_CB_ALRX_SAVE,
    FRW_ROM_CB_ALRX_CLEAR,
    FRW_ROM_CB_ALRX_RECORD_FRAME_STATUS,

    FRW_ROM_CB_DMAC_COMMON_HOOK_ADD_VAP,
    FRW_ROM_CB_DMAC_COMMON_HOOK_DEL_VAP,
    FRW_ROM_CB_DMAC_COMMON_HOOK_START_VAP,
    FRW_ROM_CB_DMAC_COMMON_HOOK_DOWN_VAP,
    FRW_ROM_CB_DMAC_COMMON_HOOK_ADD_USER,
    FRW_ROM_CB_DMAC_COMMON_HOOK_DEL_USER,

    FRW_ROM_CB_KEEPALIVE_TIMER,

    FRW_ROM_CB_DMAC_BLOCKACK_TX_ADDBA_REQ,
    FRW_ROM_CB_DMAC_BLOCKACK_RX_ADDBA_RESP,
    FRW_ROM_CB_TBTT_DEVICE,
    FRW_ROM_CB_DEVICE_INIT,
    FRW_ROM_CB_DEVICE_EXIT,

    FRW_ROM_CB_FCS_GET_PROT_MODE,
    FRW_ROM_CB_FCS_SET_DATARATE,
    FRW_ROM_CB_FCS_PREPARE_CFG,
    FRW_ROM_CB_FCS_SET_TIMEOUT,
    FRW_ROM_CB_FCS_WAIT_ONEPKT_DONE,
    FRW_ROM_CB_FCS_SEND_ONE_PKT,

    FRW_ROM_CB_FRW_RECV_MSG,
    FRW_ROM_CB_FRW_HCC_TYPE_CTL,
    FRW_ROM_CB_FRW_MSG_EXEC_CTL,
    FRW_ROM_RX_EVENT_FLUSH,

    FRD_ROM_MAC_ERROR,
    FRD_ROM_RX_PRE,
    FRD_ROM_RX_CHECK,
    FRD_ROM_RX_AMSDU,
    FRD_ROM_RX_UPDATE_DSCR,
    FRD_ROM_RX_SEND,
    FRD_ROM_RX_END,
    FRD_ROM_Q_EMPTY,

    FRD_ROM_TX_NEED_ENQ,
    FRD_ROM_TX_PRE_ENQ,
    FRD_ROM_TX_NEED_SCHE,
    FRD_ROM_TX_SCH,
    FRD_ROM_TX_DEQUE,
    FRD_ROM_TX_GET_NOPS,
    FRD_ROM_TX_HAL,
    FRD_ROM_TX_COMPLETE,
    FRD_ROM_TX_COMP_SCH,
    FRD_ROM_TX_AMPDU_COMP,
    FRD_ROM_TX_RETRY,
    FRD_ROM_TX_RETRY_AMPDU,

    FRW_ROM_MEM_POOL_NETBUF_ALLOC,
    FRW_ROM_MEM_POOL_NETBUF_FREE,
    FRW_ROM_CB_DMAC_RX_MEM_POOL_PBUF_FREE,
    FRD_ROM_WLAN_MSG_H2D_C_CFG_INIT_RX_DSCR,
    FRD_ROM_WLAN_MSG_H2D_C_CFG_DESTROY_RX_DSCR,
    FRD_ROM_WLAN_MSG_H2D_C_CFG_SYNC_SUB_WORK_TO_RF,
    FRD_ROM_WLAN_MSG_H2D_C_CFG_REQ_SYNC_PMBIT,
    FRD_ROM_WLAN_MSG_H2D_C_CFG_SYNC_WORK_VAP_STATE,
    FRD_ROM_WLAN_MSG_H2D_C_CFG_ENABLE_FRONT_END,
    FRD_ROM_WLAN_MSG_H2D_C_CFG_IDEL_SLEEP_PREPARE,
    FRW_ROM_CB_HAL_DEVICE_HW_INIT,
    FRW_ROM_CB_HAL_SCAN_PARAMS_HANDLE,
    FRW_ROM_CB_HAL_SCAN_PAUSE_HANDLE,

    FRW_ROM_CB_RX_NETBUF,
    FRW_ROM_CB_RX_MSG,
    FRW_ROM_FLUSH_DCACHE,

    FRD_ROM_TX_AMPDU_DSCR_PROC,
    FRW_ROM_CB_END,
}frw_rom_cb_enum;

/*****************************************************************************
  3 函数声明
*****************************************************************************/
osal_void frw_rom_cb_register(frw_rom_cb_enum func_id, osal_void *func_cb);
osal_void *frw_get_rom_cb(frw_rom_cb_enum func_id);

#ifdef __cplusplus
#if __cplusplus
    }
#endif
#endif
#endif

